package 工厂方法模式.改进;

import 简单的工厂模式.工厂模式demo.计算器.Operation;

/**
 * @author zyl
 * @Description
 * @since 2024/1/3 13:31
 */

public class FactoryAdvanced implements IFactory {
    @Override
    public Operation creatOperation(String operator) {
        Operation operation = null;
        switch (operator){
            case "pow":
                operation = new Pow();
                break;
            case "log":
                operation = new Log();
                break;
        }
        return operation;
    }
}
